const state = {
    alarmExceedLimit: false, // 超限
    alarmBlackListShow: false, // 黑名单
    alarmSubscription: false, // 订阅
    alarmRetrograde: false, // 逆行
    ttraffic_violative_alarm_id: null,
    ttraffic_disposition_alarm_id: null,
    tBlackListVehiclePass_id: null,
    tReverseVehicle_id: null,
    update_time: null,
    voice: true,
    init: false
};

const getters = {};

const actions = {};

const mutations = {
    // resetTrafficLatestRecord(state, record) {
    //     if (state.ttraffic_violative_alarm_id != record.ttraffic_violative_alarm_id) {
    //         state.init && (state.alarmExceedLimit = true);
    //         state.ttraffic_violative_alarm_id = record.ttraffic_violative_alarm_id;
    //     }
    //     if (state.tBlackListVehiclePass_id != record.tBlackListVehiclePass_id) {
    //         state.init && (state.alarmSubscription = true);
    //         state.tBlackListVehiclePass_id = record.tBlackListVehiclePass_id;
    //     }
    //     if (state.tReverseVehicle_id != record.tReverseVehicle_id) {
    //         state.init && (state.alarmRetrograde = true);
    //         state.tReverseVehicle_id = record.tReverseVehicle_id;
    //     }
    //     if (state.ttraffic_disposition_alarm_id != record.ttraffic_disposition_alarm_id) {
    //         state.init && (state.alarmBlackListShow = true);
    //         state.ttraffic_disposition_alarm_id = record.ttraffic_disposition_alarm_id;
    //     }
    //     state.update_time = record.update_time;
    //     state.init = true;
    // },
    removeAlarm(state, name) {
        state[name] =  false;
    },
    changeVoice(state) {
        state.voice = !state.voice;
    }
};

export default {
    namespaced: true,
    state,
    actions,
    getters,
    mutations
};
